<div>
    <div class="row">
        <div class="col-md-2"></div>
        <div class="col-md-8">
            <h2 translate="password.title" translate-values="{username: '{{account.login}}'}">Password for [<b>{{account.login}}</b>]</h2>

            <div class="alert alert-success" ng-show="success" translate="password.messages.success">
                <strong>Password changed!</strong>
            </div>
            <div class="alert alert-danger" ng-show="error"  translate="password.messages.error">
                <strong>An error has occured!</strong> The password could not be changed.
            </div>

            <div class="alert alert-danger" ng-show="doNotMatch" translate="global.messages.error.dontmatch">
              The password and its confirmation do not match!
            </div>

            <form name="form" role="form" novalidate
                  class="ng-scope ng-invalid ng-invalid-required ng-dirty ng-valid-minlength"
                  ng-submit="changePassword()">

                <div class="form-group">
                    <label translate="global.form.newpassword">New password</label>
                    <input type="password" class="form-control" name="password" placeholder="{{'global.form.newpassword.placeholder' | translate}}"
                           ng-model="password" ng-minlength=5 ng-maxlength=50 required>
                    <div class="error"
                         ng-show="form.password.$dirty && form.password.$invalid">
                        <small class="error"
                               ng-show="form.password.$error.required" translate="global.messages.validate.newpassword.required">
                            Your password is required.
                        </small>
                        <small class="error"
                               ng-show="form.password.$error.minlength" translate="global.messages.validate.newpassword.minlength">
                            Your password is required to be at least 5 characters
                        </small>
                        <small class="error"
                               ng-show="form.password.$error.maxlength" translate="global.messages.validate.newpassword.maxlength">
                            Your password cannot be longer than 50 characters
                        </small>
                    </div>
                    <password-strength-bar password-to-check="password"></password-strength-bar>
                </div>
                <div class="form-group">
                    <label translate="global.form.confirmpassword">New password confirmation</label>
                    <input type="password" class="form-control" name="confirmPassword" placeholder="{{'global.form.confirmpassword.placeholder' | translate}}"
                           ng-model="confirmPassword" ng-minlength=5 ng-maxlength=50 required>
                    <div class="error"
                         ng-show="form.confirmPassword.$dirty && form.confirmPassword.$invalid">
                        <small class="error"
                               ng-show="form.confirmPassword.$error.required" translate="global.messages.validate.confirmpassword.required">
                            Your password confirmation is required.
                        </small>
                        <small class="error"
                               ng-show="form.confirmPassword.$error.minlength" translate="global.messages.validate.confirmpassword.minlength">
                            Your password confirmation is required to be at least 5 characters
                        </small>
                        <small class="error"
                               ng-show="form.confirmPassword.$error.maxlength" translate="global.messages.validate.confirmpassword.maxlength">
                            Your password confirmation cannot be longer than 50 characters
                        </small>
                    </div>
                </div>

                <button type="submit" ng-disabled="form.$invalid" class="btn btn-primary" translate="password.form.button">Save</button>
            </form>
        </div>
        <div class="col-md-2"></div>
    </div>

</div>

